package com.example.vdmtest;


import android.os.Environment;

import com.vivo.ic.VLog;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class MainTestData {
    private static final String TAG = MainApplication.PRE_TAG + "MainTestData";
    public static final String[] URLS = new String[] {
            "http://dlied5.myapp.com/myapp/1104466820/sgame/2017_com.tencent.tmgp.sgame_h100_1.16.2.27.apk",
            "http://dldir1.qq.com/weixin/android/weixin6332android960.apk",
            "http://download.moji001.com/download/MojiWeather-V6.0106.02-release-c8888.apk",
            "http://app.suning.cn/appchannelpack/1_137_40051_1470286124121.apk",
            "http://app.autohome.com.cn/download/usedcar_app_icon.apk",
            "https://m.dianping.com/download/redirect?id=10980",
            "http://172.20.201.181:83/view/%E6%B5%8F%E8%A7%88%E5%99%A8/job/VivoBrowser-v4.4/lastSuccessfulBuild/artifact/bin/findbugs_result.xml",
    };
    
    public static ArrayList<String> getUrlsFromFile() {
        ArrayList<String> urls = new ArrayList<String>();
        String path = Environment.getExternalStorageDirectory() + "/DMDownload/";
        VLog.d(TAG, "path:" + path);
        String file = "urls.txt";
        File f = new File(path + file);
        try {
            BufferedReader br = new BufferedReader(new FileReader(f));
            String line ;
            while ((line = br.readLine()) != null) {
                urls.add(line);
            }
            br.close();
        } catch (IOException e) {
            VLog.d(TAG, "get Urls From File failed");
        }

        return urls;
    }
}
